#include "stdafx.h"
#include "AxisConversion.h"
#include "PolygonsToTriangles.h"

int main(int argc, char** argv)
{
	int res = -1;
	if (argc == 3)
	{
		DAE dae;
		domCOLLADA* collada = dae.open(argv[1]);

		if (collada)
		{
			Axisconverter converter;
			PolygonsToTriangles polyToTri;

			if (converter.init() && polyToTri.init())
			{
				converter.execute(collada->getDocumentURI()->getURI(), &dae);
				polyToTri.execute(collada->getDocumentURI()->getURI(), &dae);
				dae.saveAs(argv[2]);
				res = 0;
			}
		}
	}
	
	return res;
};